package com.yxinsur.imc.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yxinsur.imc.business.domain.ImcRenewalRecn;
import com.yxinsur.imc.business.excel.RenewalRecnTemplate;
import com.yxinsur.imc.business.form.RecnExpenseSearchForm;
import com.yxinsur.imc.business.form.RecnSearchForm;
import com.yxinsur.imc.business.vo.ContractExpenseVo;
import com.yxinsur.imc.business.vo.RenewalRecnDetailsCheckVo;
import com.yxinsur.imc.business.vo.RenewalRecnVo;
import com.yxinsur.imc.common.core.domain.AjaxResult;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 续年手续费对账单 Service接口
 *
 * @author imc
 * @date 2021-05-25
 */
public interface IImcRenewalRecnService extends IService<ImcRenewalRecn> {

    /**
     * 根据{主表ID}查询协议费用科目
     *
     * @param recnId 主表ID
     * @return 协议费用科目
     */
    List<ContractExpenseVo> listContractExpenseByRecnId(Long recnId);

    /**
     * 生成续年手续费对账单
     *
     * @param settleMonth           选择月度
     * @param supplierId            供应商ID
     * @param contractIdList        协议ID集合
     * @param contractExpenseIdList 协议费用科目ID集合
     * @return 结果
     */
    AjaxResult createRenewalRecn(String settleMonth, Long supplierId, List<Long> contractIdList, List<Long> contractExpenseIdList);

    /**
     * 导入S表并核对
     *
     * @param file   上传文件
     * @param recnId 主表ID
     * @return 结果
     * @throws Exception Exception
     */
    AjaxResult importAndCheck(MultipartFile file, Long recnId) throws Exception;

    /**
     * 查询核对结果列表
     *
     * @param searchForm RecnExpenseSearchForm
     * @return 结果
     */
    List<RenewalRecnDetailsCheckVo> listCheckResultList(RecnExpenseSearchForm searchForm);

    /**
     * 导出续年手续费核对结果
     *
     * @param searchForm RecnExpenseSearchForm
     * @return 续年手续费核对结果
     * @throws NoSuchFieldException   NoSuchFieldException
     * @throws IllegalAccessException IllegalAccessException
     */
    List<RenewalRecnTemplate> export(RecnExpenseSearchForm searchForm) throws NoSuchFieldException, IllegalAccessException;

    /**
     * 删除
     *
     * @param recnId 主表ID
     * @return 结果
     */
    AjaxResult delete(Long recnId);

    /**
     * 查询主表列表
     *
     * @param searchForm RecnExpenseSearchForm
     * @return 续年手续费对账单列表
     */
    List<RenewalRecnVo> listRenewalRecnList(RecnExpenseSearchForm searchForm);

    /**
     * 批量处理核对结果
     *
     * @param recnSearchForm RecnSearchForm
     * @return 结果
     */
    AjaxResult disposeImcRecn(RecnSearchForm recnSearchForm);

    /**
     * 提交审核
     *
     * @param recnId 主表ID
     * @return 结果
     */
    AjaxResult auditImcRecn(Long recnId);

    /**
     * 审核：通过
     *
     * @param recnId         主表ID
     * @param recnSearchForm RecnSearchForm
     * @return 结果
     */
    AjaxResult auditApproved(Long recnId, RecnSearchForm recnSearchForm);

    /**
     * 审核：退回
     *
     * @param recnId         主表ID
     * @param recnSearchForm RecnSearchForm
     * @return 结果
     */
    AjaxResult auditReturn(Long recnId, RecnSearchForm recnSearchForm);

    /**
     * 审核：反结
     *
     * @param recnId         主表ID
     * @param recnSearchForm RecnSearchForm
     * @return 结果
     */
    AjaxResult auditRevert(Long recnId, RecnSearchForm recnSearchForm);
}
